package com.android.tea;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;

public class RegActivity extends Activity implements OnClickListener{
	private EditText emailEdit;
	private EditText nickEdit;
	private EditText passWordEdit;
	private EditText rePasswordEdit;
	private RadioButton leftRadio;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.reg);
		
		initComponents();
	}

	private void initComponents() {
		Button back = (Button)findViewById(R.id.btn_back);
		back.setOnClickListener(this);
		Button finish = (Button)findViewById(R.id.btn_finish);
		finish.setOnClickListener(this);
		
		//注册信息
		emailEdit = (EditText)findViewById(R.id.edit_email);
		nickEdit = (EditText)findViewById(R.id.edit_email);
		passWordEdit = (EditText)findViewById(R.id.edit_email);
		rePasswordEdit = (EditText)findViewById(R.id.edit_email);
		
		leftRadio = (RadioButton)findViewById(R.id.radio0);
		
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_back:
			super.onBackPressed();
			break;
		case R.id.btn_finish:
			//执行注册流程
			String email = emailEdit.getText().toString();
			String nickname = nickEdit.getText().toString();
			String password = passWordEdit.getText().toString();
			String repassword = rePasswordEdit.getText().toString();
			int sex = leftRadio.isChecked()?0:1;
			//简单的校验之后就进入注册流程
			break;

		default:
			break;
		}
	}
}
